package com.zhentao.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import lombok.Data;

/**
 * 复盘单表，记录库存复盘业务
 * @TableName inventory_recheck
 */
@TableName(value ="inventory_recheck")
@Data
public class InventoryRecheck implements Serializable {
    /**
     * 主键ID，复盘单的唯一标识，用于在系统中唯一确定一张复盘单
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 复盘单编号，复盘单的唯一编号，方便业务人员管理和查询复盘单
     */
    private String recheckNo;

    /**
     * 盘点单ID，关联盘点单表的ID，表明该复盘业务是针对哪张盘点单的
     */
    private Long checkId;

    /**
     * 复盘日期，进行库存复盘的日期
     */
    private Date recheckDate;

    /**
     * 状态，单据的状态，用于跟踪复盘单的处理进度，如未开始、进行中、已完成等
     */
    private Integer status;

    /**
     * 备注信息，用于记录与该复盘单相关的额外说明，如复盘结果等
     */
    private String remark;

    /**
     * 创建人
     */
    @TableField(exist = false)
    private Long createUser;

    /**
     * 创建时间，该复盘单的创建时间，用于记录单据的创建顺序和时间
     */
    private Date createTime;

    /**
     * 租户ID，用于多租户环境下区分不同的租户，每个租户可以有自己独立的复盘单体系
     */
    private Long tenantId;

    /**
     * 仓库ID
     */
    private Long warehouseId;

    /**
     * 审核时间
     */
    private Date auditTime;

    /**
     * 作废时间
     */
    private Date voidTime;

    /**
     * 仓库名称（非数据库字段，用于显示）
     */
    @TableField(exist = false)
    private String warehouseName;

    /**
     * 明细列表（非数据库字段）
     */
    @TableField(exist = false)
    private List<InventoryRecheckItem> items;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        InventoryRecheck other = (InventoryRecheck) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getRecheckNo() == null ? other.getRecheckNo() == null : this.getRecheckNo().equals(other.getRecheckNo()))
            && (this.getCheckId() == null ? other.getCheckId() == null : this.getCheckId().equals(other.getCheckId()))
            && (this.getRecheckDate() == null ? other.getRecheckDate() == null : this.getRecheckDate().equals(other.getRecheckDate()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
            && (this.getCreateUser() == null ? other.getCreateUser() == null : this.getCreateUser().equals(other.getCreateUser()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getTenantId() == null ? other.getTenantId() == null : this.getTenantId().equals(other.getTenantId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getRecheckNo() == null) ? 0 : getRecheckNo().hashCode());
        result = prime * result + ((getCheckId() == null) ? 0 : getCheckId().hashCode());
        result = prime * result + ((getRecheckDate() == null) ? 0 : getRecheckDate().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getCreateUser() == null) ? 0 : getCreateUser().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getTenantId() == null) ? 0 : getTenantId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", recheckNo=").append(recheckNo);
        sb.append(", checkId=").append(checkId);
        sb.append(", recheckDate=").append(recheckDate);
        sb.append(", status=").append(status);
        sb.append(", remark=").append(remark);
        sb.append(", createUser=").append(createUser);
        sb.append(", createTime=").append(createTime);
        sb.append(", tenantId=").append(tenantId);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}